Notes on replication of Firearms and Accidental Deaths: Evidence from the Aftermath of the Sandy Hook School Shooting, by Phillip B. Levine and Robin McKnight

The Excel file, Google Trends data for Figure 1, provides the data to replicate Figure 1. Please note that Google Trends data are computed from a sample of Google searches, and the data in this spreadsheet reflects the results of our query at trends.google.com. If one were to repeat the same query, the data could differ somewhat from the data that our query generated, although the overall pattern would be the same.

The other figures and the table can be replicated using the two Stata.do files that are provided.  Please note that the data to replicate Figure 4 and panel 4 of Table 1 are not public-use. We provide code that generates our results, but the data necessary to run this section of the code are available only through special agreement with the National Center for Health Statistics at the CDC (for more information see: https://www.cdc.gov/nchs/nvss/dvs_data_release.htm)

inpvs1-public.do reads in the public-use Vital Statistics data and collapses them to the year-month-age group unit of observation for our analysis.  The public-use files may be downloaded at no charge at https://www.cdc.gov/nchs/data_access/vitalstatsonline.htm.
Note that, for convenience, in our program we re-named the raw data, so our file names do not match the names of the files on the website. Each reference to the files, mortXX.dat, represents the NCHS public use mortality files for year 20XX.

replication_science.do uses the data set created in inpvs1-public.do to generate the results that are reported in the figures and table.  At various points in the program, we make use of population data; these data are provided in three data sets that are labeled according to the relevant unit of observation (population-age-public, population-state-public, or population-state-age-public).  At various points in the program, we also make use of NICS background check data. These data are provided in two data sets (bckcheck-public and bckcheck-state-public), one that provides national counts of background checks and another that provides state-level counts of background checks.
